function checkForm(){
var ret=false;
var  mingcheng = document.forms['productsPropertyFForm'].elements('mingcheng').value;
		if(mingcheng==null||mingcheng==''){
			alert('商品名称不能为空');
			document.forms['productsPropertyFForm'].elements('mingcheng').focus();
			return false;
		}
var  bcId = document.forms['productsPropertyFForm'].elements('bcId').value;
	if(bcId==null||bcId==''||bcId=='-1'){
		alert('分类必须选择');
		return false;
	}
var  brandClass = document.forms['productsPropertyFForm'].elements('brandClass').value;
	if(brandClass==null||brandClass==''||brandClass=='-1'){
		alert('品牌必须选择');
		return false;
	}
var price=document.forms['productsPropertyFForm'].elements('webjia').value;
	if(ret&&(price==null||price=='')){
		document.forms['productsPropertyFForm'].elements('webjia').focus();
		alert('价格不能为空!');
		return false;
	}
 //图片必须选择
var picFile=document.forms['productsPropertyFForm'].picFile.value;
	if(picFile==null||picFile==''){
		alert('产品图片不能为空!');
		return false;
	}
return true;
}
//检查是否是价格类型
var price;
	function checkPriceIsOk(price){
	var priceValue=document.forms['productsPropertyFForm'].elements(price).value;
		if(!checkIsPrice(priceValue)){
		alert("请检查您的输入,必须是数字和.组成的价格!");
		}	    
	}
 //显示span
function showSpan(){
   alert(document.forms['productsPropertyFForm'].deliverListSpan.style.display);
//document.getElementById("deliverListSpan").style.display='true';
 }
//隐藏配送费用span
function hiddenDeliverSpan(){
   document.getElementById("deliverListSpan").style.display="none";
}
//显示配送费用span
function displayDeliverSpan(){
   document.getElementById("deliverListSpan").style.display='block';
}
// 根据选择的省,获得其所辖的市
function getCity(){
	var obj_Pro = document.getElementById("bcId");
	var obj_City = document.getElementById("scId");
	var obj_County = document.getElementById("tcId");
	var pro_Index = obj_Pro.selectedIndex;
	var pro_Value = obj_Pro.options[pro_Index].value;
		if(pro_Value != "" && pro_Value != null){
			productsManageFServ.loadSmallClassListByBIdMap(pro_Value,cityReturn);
			display();
		}else{
			DWRUtil.removeAllOptions(obj_City);
			DWRUtil.addOptions(obj_City,{'-1':'请选择'});
			DWRUtil.removeAllOptions(obj_County);
			DWRUtil.addOptions(obj_County,{'-1':'请选择'});
	    }
}
// 回调函数
function cityReturn(data){
	var obj_City = document.getElementById("scId");
	var obj_County = document.getElementById("tcId");
	DWRUtil.removeAllOptions(obj_City);
	DWRUtil.addOptions(obj_City,{'-1':'请选择'});
	DWRUtil.addOptions(obj_City,data);
	DWRUtil.removeAllOptions(obj_County);
	DWRUtil.addOptions(obj_County,{'-1':'请选择'});
}
// 根据选择的市,获得所辖的县
function getCounty(){
	var obj_Pro = document.getElementById("bcId");
	var obj_City = document.getElementById("scId");
	var scLabel="";
	var scList=obj_City.options;
		for(var j=0;j<scList.length;j++){
			if(scList[j].selected ){
			scLabel=scList[j].text;
			}
	    }
	if(scLabel.indexOf('配件') != -1 )
	{
	  hidden();
	}
	else
	{
	  display();
	}
	var obj_County = document.getElementById("tcId");
	var city_Index = obj_City.selectedIndex;
	var city_Value = obj_City.options[city_Index].value;
	if(city_Value != "" && city_Value != null){
	productsManageFServ.loadThreadClassListBySIdMap(city_Value,countyReturn);
	}else{
	DWRUtil.removeAllOptions(obj_County);
	DWRUtil.addOptions(obj_County,{'-1':'请选择'});
	}
}
// 回调函数
function countyReturn(data){
	var obj_County = document.getElementById("tcId");
	DWRUtil.removeAllOptions(obj_County);
	DWRUtil.addOptions(obj_County,{'-1':'请选择'});
	DWRUtil.addOptions(obj_County,data);
}
//隐藏相关参数
function hidden(){
	var  zhongliang =document.getElementById('zhongliangTr');
	var  zaizl =document.getElementById('zaizlTr');
	var  sudu =document.getElementById('suduTr');
	var  licheng =document.getElementById('lichengTr');
	var  dianjixh =document.getElementById('dianjixhTr');
	var  gongli =document.getElementById('gongliTr');
	var  dianya =document.getElementById('dianyaTr');
	var  capacity =document.getElementById('capacity');
	
	zhongliang.style.display="none";
	zaizl.style.display="none";
	sudu.style.display="none";
	licheng.style.display="none";
	dianjixh.style.display="none";
	gongli.style.display="none";
	dianya.style.display="none";
	capacity.style.display="none";
}
//显示相关参数
function display(){
	var  zhongliang =document.getElementById('zhongliangTr');
	var  zaizl =document.getElementById('zaizlTr');
	var  sudu =document.getElementById('suduTr');
	var  licheng =document.getElementById('lichengTr');
	var  dianjixh =document.getElementById('dianjixhTr');
	var  gongli =document.getElementById('gongliTr');
	var  dianya =document.getElementById('dianyaTr');
	var  capacity =document.getElementById('capacity');
	zhongliang.style.display="block";
	zaizl.style.display="block";
	sudu.style.display="block";
	licheng.style.display="block";
	dianjixh.style.display="block";
	gongli.style.display="block";
	dianya.style.display="block";
	capacity.style.display="block";
}
function openPBrandPage(){
    var win=window.open("/sale/manage/productsPropertyF.do?action=loadPBrandList","","width=400px height=400px");//打开一窗口
}
